package soccerBet.project.services;

import java.io.File;

import java.io.IOException;

import java.io.InputStream;

import java.text.SimpleDateFormat;

import java.util.ArrayList;

import java.util.Date;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import net.sf.jxls.exception.ParsePropertyException;

import net.sf.jxls.transformer.XLSTransformer;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;

import soccerBet.project.Calculation.AvaliationFunction;

import soccerBet.project.dao.ClassificacaoDAO;
import soccerBet.project.dao.ConfiguracaoDAO;

import soccerBet.project.dao.EmailDAO;

import soccerBet.project.dao.JogoDAO;

import soccerBet.project.mail.SendMailTLS;

import soccerBet.project.main.Historico;

import soccerBet.project.objects.Classificacao;
import soccerBet.project.objects.Configuracao;

import soccerBet.project.objects.Email;

import soccerBet.project.objects.InfoPrecos;

import soccerBet.project.objects.Jogo;

import soccerBet.project.objects.Runner;

import soccerBet.project.utils.BuildText;
import soccerBet.project.utils.Utils;

public class ClassificacaoService {

	List<Integer> epocaLigaIdsList = new ArrayList<Integer>();

	public ClassificacaoService(List<Integer> epocaLigaIdsList) {
		this.epocaLigaIdsList = epocaLigaIdsList;
	}

	public void enviaClassificacao() {

		String text = "";
		ClassificacaoDAO classificacaoDao = new ClassificacaoDAO();

		for (int i = 0; i < this.epocaLigaIdsList.size(); i++) {

			List<Classificacao> classList = classificacaoDao
					.getClassificacaoList(this.epocaLigaIdsList.get(i));

			text += BuildText.buildClassificacao(classList);
		}
		
		SendMailTLS sendMail = new SendMailTLS("Tabela classificativa",text);
		sendMail.enviaEmail();
	}

}
